package com.truongnha.clienttn.business.service;

import android.content.Context;

import com.truongnha.clienttn.business.model.UserModel;
import com.truongnha.clienttn.data.dao.AccountDAO;
import com.truongnha.clienttn.data.dao.CreateDatabase;
import com.truongnha.clienttn.data.entity.AccountEntity;

public class ProfileService {
	private UserModel user;
	private Context context;
	public ProfileService(Context context) {
		super();
		this.context = context;
		CreateDatabase db = new CreateDatabase(context);
		AccountDAO accountDAO = new AccountDAO(db.open());
		AccountEntity accountEntity = accountDAO.getCurrentAccount();
		db.close();
		user = new UserModel(accountEntity);		
	}
	public UserModel getUser() {
		return user;
	}
	
}
